package com.itheima.demo;

import com.itheima.domain.Dept;
import com.itheima.domain.Emp;
import com.itheima.mapper.EmpMapper;
import com.itheima.utils.MapperUtil;

import java.util.List;

public class Demo {
    public static void main(String[] args) {
        EmpMapper mapper = MapperUtil.getMapper(EmpMapper.class);
        List<Emp> list = mapper.findAll();
        System.out.println("总人数: " + list.size());
        for (Emp emp : list) {
            System.out.println(emp);
            Dept dept = emp.getDept();
            System.out.println("部门: " + dept.getDname() + "\t\t" + dept.getLoc());
            System.out.println("========");
        }


    }
}
